package cn.jobstart.es.vo;

import cn.jobstart.common.StringUtil;
import cn.jobstart.common.YXDate;
import cn.jobstart.vo.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author sunke
 * @version 1.0
 * @Description
 * @date 2023-09-08 15:43
 */
@Data
@ApiModel("es返回简历VO")
public class ResumeEsVO implements Serializable {

    @JsonIgnore
    private int thirdAge=-1;

    public static  ResumeEsVO getInstance(){
        return new ResumeEsVO();
    }


    //匹配向量值
    @JsonIgnore
    private int matchingVector = 0;


    private float score;
    private String personId;
    private String id;
    private String talentSubscriptionTaskId;
    /**
     * 来源
     */
    private Integer source;
    /**
     * 简历名称
     */
    private String title;
    /**
     * qq
     */
    private String qq;
    /**
     * 婚姻状况
     */
    private String marriage;
    /**
     * 婚姻状况 0保密  1未婚 2已婚
     * 0:保密:secret,1:未婚:un_married,2:已婚:married
     */
    private Integer marriageFlag;
    /**
     * 开始工作年限
     */
    private String firstWork;
    /**
     * 出生地
     */
    private String birthPlace;
    /**
     * 真实姓名
     */

    private String truename;
    /**
     * 求职意向
     */
    private String expectWork;
    /**
     * 性别
     */
    private String sex;
    /**
     * 性别 0 保密 1 男 2女
     * 0:保密:secret,1:男:male,2:女:female
     */
    private Integer sexFlag;
    /**
     * 出生日期
     */
    private Date birthday;
    /**
     * 民族
     */
    private String nation;
    /**
     * 籍贯
     */
    private String expectcity;
    /**
     * 居住地
     */
    private String livePlace;
    /**
     * 政治面貌
     */
    private String politics;
    /**
     * 政治面貌
     * 0:群众:the_masses,1:党员:party_member,2:预备党员:probationary_party_member,3:团长:league_member,4:其它:other
     */
    private Integer politicsFlag;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 手机号
     */
    private String mobile;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 求职城市
     */
    private String exceptCity;
    /**
     * 求职意向
     */
    private String category;
    /**
     * 求职意向id
     */
    private String categoryId;
    /**
     * 期望职位
     */
    private String exceptWork;
    /**
     * (数据来源)简历创建时间
     */
    private Date resumeCreateTime;
    /**
     * 完整度
     */
    private String integrity;
    /**
     * 简历更新时间
     */
    private Date resumeModifyTime;
    /**
     * 期望行业
     */
    private String parentCategory;
    /**
     * 期望行业id
     */

    private String parentCategoryId;
    /**
     * 期望职位二级类型
     */
    private String secondCategory;
    /**
     * 期望职位二级类型id
     */

    private String secondCategoryId;
    /**
     * 工作经验
     */
    private String jobYear;
    private Integer workExperienceFlag;
    /**
     * 学历
     */
    private String education;
    /**
     * 身高体重
     */
    private String height;


    // @ApiModelProperty(value = "工作经验 0:不限:unlimit,1:1年以内:one_down,2:1-3年:one_three,3:3-5年:three_five,4: 5-10年:five_ten,5:10年以上:ten_up")
    /**
     * 当前薪资
     */
    private BigDecimal currentSalary;
    /**
     * 期望薪资
     */
    private BigDecimal expectedSalary;
    /**
     * 学校
     */
    private String school;
    /**
     * 专业
     */
    private String speciality;
    /**
     * 一句话总结
     */
    private String summary;
    /**
     * 其它信息
     */
    private String otherInfo;

    private String thirdAccountId;

    /**
     * 在校经历
     */
    @JsonIgnore
    private String associationActivity;
    private List<ResumeAssociationActivityMiniDomainVO> associationActivityList;
    /**
     * 能力标签
     */
    @JsonIgnore
    private String capabilityLabel;
    private List<ResumeCapabilityLabelMiniDomainVO> capabilityLabelList;
    /**
     * 证书
     */
    @JsonIgnore
    private String certificate;
    private List<ResumeCertificateMiniDomainVO> certificateList;
    /**
     * 教育经历
     */
    @JsonIgnore
    private String educationalExperience;
    private List<ResumeEducationalExperienceMiniDomainVO> educationalExperienceList;
    /**
     * 求职意向
     */
    @JsonIgnore
    private String employmentIntention;
    private List<ResumeEmploymentIntentionMiniDomainVO> employmentIntentionList;
    /**
     * 实习经历
     */
    @JsonIgnore
    private String internship;
    private List<ResumeIntershipMiniDomainVO> internshipList;
    /**
     * 专业技能
     */
    @JsonIgnore
    private String professionalSkills;
    private List<ResumeProfessionalSkillsMiniDomainVO> professionalSkillsList;
    /**
     * 项目经历
     */
    @JsonIgnore
    private String projectExperience;
    private List<ResumeProjectExperienceMiniDomainVO> projectExperienceList;
    /**
     * 培训经历
     */
    @JsonIgnore
    private String trainingExperience;
    private List<ResumeTrainingExperienceMiniDomainVO> trainingExperienceList;
    /**
     * 工作经历
     */
    @JsonIgnore
    private String workExperience;
    private String idcard;
    private List<ResumeWorkExperienceMiniDomainVO> workExperienceList;

    @Override
    public String toString() {
        return "ResumeEsVO{" + "score=" + score + ", personId='" + personId + '\'' + ", id='" + id + '\'' + ", talentSubscriptionTaskId='" + talentSubscriptionTaskId + '\'' + ", source=" + source + ", title='" + title + '\'' + ", qq='" + qq + '\'' + ", marriage='" + marriage + '\'' + ", marriageFlag=" + marriageFlag + ", firstWork='" + firstWork + '\'' + ", birthPlace='" + birthPlace + '\'' + ", truename='" + truename + '\'' + ", expectWork='" + expectWork + '\'' + ", sex='" + sex + '\'' + ", sexFlag=" + sexFlag + ", birthday=" + birthday + ", nation='" + nation + '\'' + ", expectcity='" + expectcity + '\'' + ", livePlace='" + livePlace + '\'' + ", politics='" + politics + '\'' + ", politicsFlag=" + politicsFlag + ", email='" + email + '\'' + ", mobile='" + mobile + '\'' + ", age=" + age + ", exceptCity='" + exceptCity + '\'' + ", category='" + category + '\'' + ", categoryId='" + categoryId + '\'' + ", exceptWork='" + exceptWork + '\'' + ", resumeCreateTime=" + resumeCreateTime + ", integrity='" + integrity + '\'' + ", resumeModifyTime=" + resumeModifyTime + ", parentCategory='" + parentCategory + '\'' + ", parentCategoryId='" + parentCategoryId + '\'' + ", secondCategory='" + secondCategory + '\'' + ", secondCategoryId='" + secondCategoryId + '\'' + ", jobYear='" + jobYear + '\'' + ", workExperienceFlag=" + workExperienceFlag + ", education='" + education + '\'' + ", height='" + height + '\'' + ", currentSalary=" + currentSalary + ", expectedSalary=" + expectedSalary + ", school='" + school + '\'' + ", speciality='" + speciality + '\'' + ", summary='" + summary + '\'' + ", otherInfo='" + otherInfo + '\'' + ", associationActivity='" + associationActivity + '\'' + ", associationActivityList=" + associationActivityList + ", capabilityLabel='" + capabilityLabel + '\'' + ", capabilityLabelList=" + capabilityLabelList + ", certificate='" + certificate + '\'' + ", certificateList=" + certificateList + ", educationalExperience='" + educationalExperience + '\'' + ", educationalExperienceList=" + educationalExperienceList + ", employmentIntention='" + employmentIntention + '\'' + ", employmentIntentionList=" + employmentIntentionList + ", internship='" + internship + '\'' + ", internshipList=" + internshipList + ", professionalSkills='" + professionalSkills + '\'' + ", professionalSkillsList=" + professionalSkillsList + ", projectExperience='" + projectExperience + '\'' + ", projectExperienceList=" + projectExperienceList + ", trainingExperience='" + trainingExperience + '\'' + ", trainingExperienceList=" + trainingExperienceList + ", workExperience='" + workExperience + '\'' + ", idcard='" + idcard + '\'' + ", workExperienceList=" + workExperienceList + '}';
    }

    public String getIntegrity() {
        int result = 20;
        if (StringUtil.isNotObjEmpty(getEmploymentIntentionList())) {
            result += 20;
        }
        if (StringUtil.isNotObjEmpty(getEducationalExperienceList())) {
            result += 20;
        }
        if (StringUtil.isNotObjEmpty(getWorkExperienceList())) {
            result += 20;
        }
        if (StringUtil.isNotObjEmpty(getProjectExperienceList())) {
            result += 10;
        }
        if (StringUtil.isNotObjEmpty(getInternshipList())) {
            result += 10;
        }
        integrity = result + "";

        return integrity;
    }

    public Integer getAge() {
        if (StringUtil.isNotObjEmpty(getBirthday())) {
            age = YXDate.getYearSub(getBirthday(), new Date());
        }
        return age;
    }

    public List<ResumeCapabilityLabelMiniDomainVO> getCapabilityLabelList() {
        if (StringUtil.isNotObjEmpty(capabilityLabelList)) {
            return capabilityLabelList;
        }
        capabilityLabelList = StringUtil.getListByJsonArrayStr(getCapabilityLabel(), ResumeCapabilityLabelMiniDomainVO.class);

        return capabilityLabelList;
    }

    public List<ResumeWorkExperienceMiniDomainVO> getWorkExperienceList() {
        if (StringUtil.isNotObjEmpty(workExperienceList)) {
            return workExperienceList;
        }
        workExperienceList = StringUtil.getListByJsonArrayStr(getWorkExperience(), ResumeWorkExperienceMiniDomainVO.class);
        return workExperienceList;
    }


    public List<ResumeTrainingExperienceMiniDomainVO> getTrainingExperienceList() {
        if (StringUtil.isNotObjEmpty(trainingExperienceList)) {
            return trainingExperienceList;
        }


        trainingExperienceList = StringUtil.getListByJsonArrayStr(getTrainingExperience(), ResumeTrainingExperienceMiniDomainVO.class);

        return trainingExperienceList;
    }

    public List<ResumeProjectExperienceMiniDomainVO> getProjectExperienceList() {
        if (StringUtil.isNotObjEmpty(projectExperienceList)) {
            return projectExperienceList;
        }
        projectExperienceList = StringUtil.getListByJsonArrayStr(getProjectExperience(), ResumeProjectExperienceMiniDomainVO.class);
        return projectExperienceList;
    }

    public List<ResumeProfessionalSkillsMiniDomainVO> getProfessionalSkillsList() {
        if (StringUtil.isNotObjEmpty(professionalSkillsList)) {
            return professionalSkillsList;
        }
        professionalSkillsList = StringUtil.getListByJsonArrayStr(getProfessionalSkills(), ResumeProfessionalSkillsMiniDomainVO.class);

        return professionalSkillsList;
    }

    public List<ResumeIntershipMiniDomainVO> getInternshipList() {
        if (StringUtil.isNotObjEmpty(internshipList)) {
            return internshipList;
        }
        internshipList = StringUtil.getListByJsonArrayStr(getInternship(), ResumeIntershipMiniDomainVO.class);
        return internshipList;
    }

    public List<ResumeAssociationActivityMiniDomainVO> getAssociationActivityList() {
        if (StringUtil.isNotObjEmpty(associationActivityList)) {
            return associationActivityList;
        }

        associationActivityList = StringUtil.getListByJsonArrayStr(getAssociationActivity(), ResumeAssociationActivityMiniDomainVO.class);
        return associationActivityList;
    }

    public List<ResumeEmploymentIntentionMiniDomainVO> getEmploymentIntentionList() {
        if (StringUtil.isNotObjEmpty(employmentIntentionList)) {
            return employmentIntentionList;
        }
        employmentIntentionList = StringUtil.getListByJsonArrayStr(getEmploymentIntention(), ResumeEmploymentIntentionMiniDomainVO.class);
        return employmentIntentionList;
    }

    public List<ResumeEducationalExperienceMiniDomainVO> getEducationalExperienceList() {
        if (StringUtil.isNotObjEmpty(educationalExperienceList)) {
            return educationalExperienceList;
        }
        educationalExperienceList = StringUtil.getListByJsonArrayStr(getEducationalExperience(), ResumeEducationalExperienceMiniDomainVO.class);
        return educationalExperienceList;
    }

    public List<ResumeCertificateMiniDomainVO> getCertificateList() {
        if (StringUtil.isNotObjEmpty(certificateList)) {
            return certificateList;
        }
        certificateList = StringUtil.getListByJsonArrayStr(getCertificate(), ResumeCertificateMiniDomainVO.class);
        return certificateList;
    }


}
